#include "mycontrol.h"

MyControl* MyControl::db=nullptr;
MyControl::MyControl()
{

}

MyControl *MyControl::getInstance()
{
    if(db==nullptr)
    {
        MyControl::db=new MyControl();
    }
    return db;
}

BaseModel* MyControl::Creatmodel(QString tableName)
{
    if(tableName=="user")
    {
        this->model=new UserModel();

    }
    if(tableName=="wuping")
    {
        this->model=new StockRecordModel();
    }
    if(tableName=="inout")
    {
        this->model=new InOutStockModel();
    }

    return model;
}

